<?php
namespace app\web\model;

/**
 * @package app\basic\model
 */
class ProjectTechnician extends Common 
{

    public static function getProjectIdByTechnician($id,$shop_id)
    {
        return self::where(['technician_id'=>$id,'shop_id'=>$shop_id])->column('project_id');
    }
    /**
     * 根据项目分类id获取技师id
     * [getTidByCategoryID description]
     * @param  [type] $category_id [description]  项目分类ID
     * @return [type]              [description]  
     */
    public static function getTidByCategoryID($category_id)
    {
        $project_id = Project::where(['category_id'=>$category_id,'all_status'=>1])->column('id');
        if(!$project_id) return 0;
        $ids = self::where('project_id','in',$project_id)->column('technician_id');
        if(!$ids) return 0;
        return $ids; 
    }
}
